﻿#pragma once

#include <string>
#include "CommandReceiver.h"


/// @brief 抽象命令类
/// @details 命令对象，包含命令请求的细节
class Command
{
public:
    Command() {}
    virtual ~Command() {}

public:
    /// @brief 执行命令
    virtual void execute() = 0;
};


/// @brief 创建梯形命令
class TrapezoidCommand : public Command
{
public:
    TrapezoidCommand(
        CommandReceiver *r, 
        const std::string &n, 
        const std::string &w, 
        const std::string &h, 
        const std::string &t)
        : receiver(r), name(n), width(w), height(h), theta(t) {}

public:
    virtual void execute() override;

private:
    CommandReceiver *receiver;
    std::string name, width, height, theta;
};


/// @brief 拉伸模型命令
class ExtrudeCommand : public Command
{
public:
    ExtrudeCommand(
        CommandReceiver *r, 
        const std::string &n, 
        const std::string &s, 
        const std::string &d)
        : receiver(r), name(n), source(s), distance(d) {}

public:
    virtual void execute() override;

private:
    CommandReceiver *receiver;
    std::string name, source, distance;
};


/// @brief 显示模型命令
class ShowCommand : public Command
{
public:
    ShowCommand(CommandReceiver *r)
        : receiver(r) {}

public:
    virtual void execute() override;

private:
    CommandReceiver *receiver;
};


/// @brief 清除模型命令
class ClearCommand : public Command
{
public:
    ClearCommand(CommandReceiver *r) 
        : receiver(r) {}

public:
    virtual void execute() override;

private:
    CommandReceiver *receiver;
};

